<?php
class BuyLogModel extends Db {
	
	private $_log = 'd_buy_log';
	
	public function addLog($params) {
		return $this->add ( $this->_log, $params );
	}
	
	public function getLogByOrderId($orderid) {
		return $this->getAll ( $this->_log, array ('orderid' => $orderid ), null, 'id DESC', 10 );
	}
	
	/**
	 * 
	 * @return BuyLogModel
	 */
	public static function instance() {
		return parent::_instance ( __CLASS__ );
	}
}